<script src='<?php echo DIR_JS?>ui.datepicker.js' type='text/javascript' language='javascript'> </script>
<div class="section" id="sitemaplist">
<form name="frm" action="index.php?route=category/employee/quickadd" method="post" enctype="multipart/form-data">
	<div class="section-title">
    	EMPLOYEE INFORMATION   
        <div class="button right">
            <input type="submit" value="<?php echo $this->document->text['button_save']?>" class="button"/>
            <input type="button" value="<?php echo $this->document->text['button_cancel']?>" class="button" onclick="window.close()"/>   
            <input type="hidden" name="userid" value="<?php echo $user['userid']?>" />   
        </div>
        <div class="clearer">^&nbsp;</div>
    </div>
    
    <div class="section-content padding1">
        
        	<div>
            	<p style="display:none">
            		<label><?php echo $this->document->text['text_username']?></label><br />
					<input type="text" name="username" value="customer123456" class="text" size=60 <?php echo $usernamereadonly?>/>
                    <?php echo $error['username']?>
            	</p>
              	<?php if($haspass){?>
                <p style="display:none">
            		<label>Password</label><br />
					<input type="password" name="password" value="<?php echo $user['password']?>" class="text" size=60 />
                    <i class="error"><?php echo $error['password']?></i>
            	</p>
                <p style="display:none">
            		<label>Confrim password</label><br />
					<input type="password" name="confrimpassword" value="<?php echo $user['confrimpassword']?>" class="text" size=60 />
                    <i class="error"><?php echo $error['confrimpassword']?></i>
            	</p>
                <?php }?>
                <p style="display:none">
            		<label>User type</label><br />
					<select name="usertypeid">
<?php
	foreach($usertype as $item)
    {
    	$sel="";
    	if($user['usertypeid'] == $item['usertypeid'])
        	$sel='selected="selected"';
?>
						<option value="<?php echo $item['usertypeid']?>" <?php echo $sel?>><?php echo $item[usertypename]?></option>
<?php
    }
?>
                    </select>
            	</p>
                <p>
            		<label><?php echo $this->document->text['text_fullname']?></label> : <input type="text" name="fullname" value="<?php echo $user['fullname']?>" class="text" size=60 />
                    <?php echo $error['fullname']?>
            	</p>
                <p>
            		<label><?php echo $this->document->text['text_birthday']?></label> : 
<script language="javascript">
 	$(function() {
		$("#birthday").datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'dd-mm-yy'
				});
		});
 </script>
					<input type="text" id="birthday" name="birthday" value="<?php echo $this->date->formatMySQLDate($user['birthday'])?>" class="text" size=60/>
                    <?php echo $error['birthday']?>
            	</p>
                <p>
            		<label><?php echo $this->document->text['text_email']?></label> : 
					<input type="text" name="email" value="<?php echo $user['email']?>" class="text" size=60 />
                    <?php echo $error['email']?>
            	</p>
                <p>
            		<label><?php echo $this->document->text['text_phone']?></label> : 
					<input type="text" name="phone" value="<?php echo $user['phone']?>" class="text" size=60 />
                    <?php echo $error['phone']?>
            	</p>
                <p>
            		<label><?php echo $this->document->text['text_fax']?></label> : 
					<input type="text" name="fax" value="<?php echo $user['fax']?>" class="text" size=60 />
                    <?php echo $error['fax']?>
            	</p>
                <p>
            		<label><?php echo $this->document->text['text_address']?></label> : 
					<input type="text" name="address" value="<?php echo $user['address']?>" class="text" size=60 />
            	</p>
				<p>
            		<label><?php echo $this->document->text['text_taxcode']?></label> : 
					<input type="text" name="taxcode" value="<?php echo $user['taxcode']?>" class="text" size=60 />
                    <?php echo $error['taxcode']?>
            	</p>
				<p>
            		<label><?php echo $this->document->text['text_bankaccount']?></label> : 
					<input type="text" name="bankaccount" value="<?php echo $user['bankacount']?>" class="text" size=60 />
                    <?php echo $error['bankaccount']?>
            	</p>
                <p style="display:none">
            		<label>Avatar</label> : 
					<p id="pnImage"  style="display:none">
                        <label for="image"><?php echo $entry_image?></label><br />
                        <a id="btnAddImage" class="button">Select photo</a><br />
                        <img id="preview" src="<?php echo $user['imagethumbnail']?>" />
                        <input type="hidden" id="imagepath" name="imagepath" value="<?php echo $user['imagepath']?>" />
                        <input type="hidden" id="imageid" name="imageid" value="<?php echo $user['imageid']?><?php echo $imageid?>" />
                        <input type="hidden" id="imagethumbnail" name="imagethumbnail" value="<?php echo $user['imagethumbnail']?>" />
                    </p>
                        
                        
                    <div id="errorupload" class="error" style="display:none"></div>
                    
                    <div class="loadingimage" style="display:none"></div>
            	</p>
                <p>
            		<label><?php echo $this->document->text['text_country']?></label> : 
					<select id="countrycode" name="countrycode" >
<?php
	foreach($countries as $item)
    {
    	$sel="";
    	if($user['countrycode'] == $item['iso_code_2'])
        	$sel='selected="selected"';
?>
						<option value="<?php echo $item['iso_code_2']?>" <?php echo $sel?>><?php echo $item['countryname']?></option>
<?php
    }
?>
                    </select>
                    <input type="hidden" id="country" name="country" value="<?php echo $user['country']?>" />
            	</p>
                <p>
            		<label><?php echo $this->document->text['text_provincecity']?></label> : 
					<select id="zoneid" name="zoneid">
                    </select> <label id="loading">Loading...</label>
                    <input type="hidden" id="provincecity" name="provincecity" value="<?php echo $user['provincecity']?>" />
            	</p>
            </div>
            
        
    
    </div>
</form>    
</div>

<script src='<?php echo DIR_JS?>ajaxupload.js' type='text/javascript' language='javascript'> </script>
<script src="<?php echo DIR_JS?>jquery.tabs.pack.js" type="text/javascript"></script>

<script type="text/javascript" charset="utf-8">
var DIR_UPLOADPHOTO = "<?php echo $DIR_UPLOADPHOTO?>";
$(document).ready(function() { 
	$("#zoneid").load("?route=common/country/getzonescb&countrycode="+$("#countrycode").val()+"&selectzone=<?php echo $user['zoneid']?>",function(){
		$("#country").val($("#countrycode option:selected").text());
		$("#provincecity").val($("#zoneid option:selected").text());
		$("#loading").hide();
	});
	$("#countrycode").change(function(){
		$("#loading").show();
		$('#zoneid').load('?route=common/country/getzonescb&countrycode='+$(this).val(), function(){
			$("#loading").hide();
		});
		$("#country").val($(this).find("option:selected").text());
	});
	
	$("#zoneid").change(function(){
		$("#provincecity").val($(this).find("option:selected").text());
	});
});
</script>

<script src="<?php echo DIR_JS?>uploadpreview.js" type="text/javascript"></script>

<?php if($completeadd == true) {?>
	<select class="cbuser">
		<?php echo $cb_partner?>
	</select>
	
	<script>
		$(document).ready(function(){
			partner = window.opener.document.getElementById("cbpartner");
			$(partner).html($(".cbuser").html());
			window.close();
		});
	</script>
	
<?php } ?>
